<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script>
    // 通过对象字面量方式创建一个对象
    var person1 = {
      name : "zs",
      age : 18,
      sex : "male",
      sayHi : function () {
        console.log(this.name + "向你说您好");
      }
    };

    // 遍历对象
    for (var k in person1) {
      // k 存储的是每一条数据的属性名或者方法名
      console.log(k + "属性的属性值为" + person1[k]);
    }
  </script> 
</head>

<body>

</body>

</html>